<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
		<link rel="stylesheet" href="../../css/mui.min.css" type="text/css" charset="utf-8" />
		<style>
			.text-center{text-align: center;}
			.dialog-content{padding:0rem 0.2rem 0.2rem 0.2rem;}
			.line {
				background: #0ab0e4;
				height: 2px;
				width: 100%;
			}
			.title{
				color:#0ab0e4;
				line-height:1rem; margin:0px;
			}
			.dialogContent{
				padding:0.4rem 0.2rem; 
				color: #666; 
			}
			 
			.dialogContent p,button,.title{
				font-size:16px !important;
			}
			.dialog-content .buttons button {
				width: 48%;
			    background: #fff;
			    border: 1px solid #0ab0e4;
    			color: #0ab0e4;
			    border-radius: 3px;
			    padding: 0px;
			    height:0.72rem;
			    line-height:0.72rem; outline: none;
			}
			
			.dialog-content .buttons button.confrim {
				background: #0ab0e4;
				border: none;
				color: #fff;
				border-radius: 3px;
			}
		</style>
	</head>
	<body style="background:transparent !important;text-align: center;">
		<div class="loading mui-hidden" style="background:#fff;padding:20px 10px 20px 20px;display: inline-block;border-radius:5px;margin:auto;">
			<div class="mui-pull-loading mui-icon mui-spinner"></div>
		</div>
		 
			<div class="dialog-content" style="background:#fff;">
			<p class="colorblue title  text-center"></p>
			<div class="line"></div>
			<div class="dialogContent text-center"><p class="dialogCon"></p></div>
			<div class="buttons text-center">
			<button id="dialog-cancel" >取消</button> 
			<button class="confrim"  id="dialog-confrim">确定</button> 
			
 		 <script src="../../js/resize.js"></script>
		 <script src="../../js/mui.min.js"></script>
		  <script src="../../js/ajaxFun.js"></script>
		<script>
		
		(function($, doc) {
			$.plusReady(function() {
				var current=plus.webview.currentWebview();
				var indexView = plus.webview.getWebviewById('jxsInfo');

				var detailPage=null;
				var parseData = current.parseData ? current.parseData : '';
				var status = current.status;
				var title=status==1?'暂停渠道':'启用渠道';
				var msg=status==1?'确定暂停该渠道吗？<br/>暂停后将无法向该渠道发货！':'确定启用该渠道吗';	
				document.querySelector('.title').innerHTML=title;
				document.querySelector('.dialogCon').innerHTML=msg;
					
				mui(document.body).on('tap', '#dialog-cancel', function(e) {
					indexView.setStyle({mask:"none"});
					current.close();
				})
				mui(document.body).on('tap', '#dialog-confrim', function(e) {
					var loadingEle=document.querySelector('.loading');
					removeClass(loadingEle,'mui-hidden') ;
					addClass(document.querySelector('.dialog-content'),'mui-hidden');			
					if(parseData){
						var url = baseUrl + 'dealersController/editDealerStatus.do';
						setTimeout(function(){
							ajaxFun.postFun(url, parseData, '', function(d) {
								addClass(loadingEle,'mui-hidden') ;
								indexView.setStyle({mask:"none"});
								plus.nativeUI.alert(d.msg,function(){
				  					mui.fire(plus.webview.getWebviewById('jxsInfoChild'),'reloadChild',{status:!status});
								});
							},function(d){
								addClass(loadingEle,'mui-hidden') ;
								indexView.setStyle({mask:"none"});
								plus.nativeUI.alert(d.msg,function(){
				  					mui.fire(plus.webview.getWebviewById('jxsInfoChild'),'reloadChild',{status:!status});
								});
							})
						},500) 
					}else{
						addClass(loadingEle,'mui-hidden') ;
						indexView.setStyle({mask:"none"});
						plus.nativeUI.alert(d.msg);					 
					}
				});


				 
			 
			})
		}(mui,document))
			
			
			
			
		</script>  
	</body>
</html>
